<?php
namespace app\backstage\controller;
use think\Controller;
use think\Db;
use think\facade\Request;

class Payment extends Controller
{
    protected $middleware = [
        'VerifyJwt' => ['except' => []],
        'VerifyPower' => ['except' => []],
    ];

    public function index()
    {
        $this->assign('role_name', request()->_role->alias);
        return $this->fetch();
    }

    public function list_data()
    {
        $params = Request::param('', '', 'strip_tags');
        $Payment = \think\facade\App::model('Payment', 'logic');
        $result = $Payment->getList($params);

        if ($result['count'] > 0) {

            return ['code' => 1, 'msg' => '数据获取成功', 'count' => $result['count'], 'data' => $result['list'],'totalRow'=>$result['totalRow']];
        }

        return ['code' => 0, 'msg' => '暂无数据', 'count' => $result['count'], 'data' => $result['list'],'totalRow'=>['total_money'=>0]];
    }

}